package com.tusuo.stds.ui.fillinfo;

import android.content.Context;
import android.content.Intent;
import com.hannesdorfmann.mosby.mvp.MvpBasePresenter;
import com.tusuo.stds.MyApp;
import com.tusuo.stds.di.DaggerScope;
import com.tusuo.stds.ui.bindnew.BindNewActivity_;
import com.tusuo.stds.ui.linkaccount.LinkAccountActivity_;
import com.tusuo.stds.ui.login.ThirdLoginUserInfo;

import org.parceler.Parcels;

import autodagger.AutoComponent;
import autodagger.AutoInjector;

/**
 * @author J.Huang
 * @version 1.0
 *
 */

@AutoComponent(
        dependencies = MyApp.class
)
@AutoInjector
@DaggerScope(FillInfoPresenter.class)
class FillInfoPresenter extends MvpBasePresenter<FillInfoView> {

    private Context mContext;

    FillInfoPresenter(Context context) {
        mContext = context;
    }

    void linkAccount(ThirdLoginUserInfo thirdLoginUserInfo) {
        Intent intent = new Intent();
        intent.setClass(mContext, LinkAccountActivity_.class);
        intent.putExtra(ThirdLoginUserInfo.EXTRA_NAME, Parcels.wrap(thirdLoginUserInfo));
        mContext.startActivity(intent);
    }

    void bindNew(ThirdLoginUserInfo thirdLoginUserInfo) {
        Intent intent = new Intent();
        intent.setClass(mContext, BindNewActivity_.class);
        intent.putExtra(ThirdLoginUserInfo.EXTRA_NAME, Parcels.wrap(thirdLoginUserInfo));
        mContext.startActivity(intent);
    }
}
